package org.lendoo.web.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.lendoo.web.entity.WeChatJscode2SessionLog;
import org.lendoo.web.enumeration.ServiceResultEnum;
import org.lendoo.web.mapper.WeChatJscode2SessionLogMapper;
import org.lendoo.web.pojo.common.ServiceResult;
import org.lendoo.web.service.WeChatJscode2SessionLogService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;

@Slf4j
@Service
public class WeChatJscode2SessionLogServiceImpl extends ServiceImpl<WeChatJscode2SessionLogMapper, WeChatJscode2SessionLog> implements WeChatJscode2SessionLogService {

    @Resource
    private ServiceHelper serviceHelper;

    /**
     * 添加
     * @param weChatJscode2SessionLog
     * @return
     */
    @Override
    public ServiceResult<Boolean> addWeChatJscode2SessionLog(WeChatJscode2SessionLog weChatJscode2SessionLog) {
        serviceHelper.getWeChatJscode2SessionLogMapper().insert(weChatJscode2SessionLog);
        ServiceResult<Boolean> serviceResult = new ServiceResult<>();
        serviceResult.setSuccess(Boolean.TRUE);
        serviceResult.setCode(ServiceResultEnum.INSERT_SUCCESS.getCode());
        serviceResult.setMessage(ServiceResultEnum.INSERT_SUCCESS.getMessage());
        serviceResult.setResult(Boolean.TRUE);
        return serviceResult;
    }
}
